<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Ticket Details</f:facet>


        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/TicketEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty ticketFrom ? 'TicketList' : ticketFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Reservation</h:panelGroup>
        </f:facet>
    <div class="association" id="reservationParent">

        <h:outputText value="There is no reservation associated with this ticket."
                   rendered="#{ticketHome.instance.reservation == null}"/>

        <rich:dataTable var="_reservation"
                   value="#{ticketHome.instance.reservation}"
                rendered="#{ticketHome.instance.reservation != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="reservationTable">
            <h:column>
                <f:facet name="header">Idreservation</f:facet>
                <h:outputText value="#{_reservation.idreservation}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Client idclient</f:facet>
                <h:outputText value="#{_reservation.client.idclient}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Voyage id voyage</f:facet>
                <h:outputText value="#{_reservation.voyage.idVoyage}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Date reservation</f:facet>
                <h:outputText value="#{_reservation.dateReservation}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewreservation"
                     value="View"
                      view="/Reservation.xhtml">
                    <f:param name="reservationIdreservation"
                           value="#{_reservation.idreservation}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Categorie</h:panelGroup>
        </f:facet>
    <div class="association" id="categorieParent">

        <h:outputText value="There is no categorie associated with this ticket."
                   rendered="#{ticketHome.instance.categorie == null}"/>

        <rich:dataTable var="_categorie"
                   value="#{ticketHome.instance.categorie}"
                rendered="#{ticketHome.instance.categorie != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="categorieTable">
            <h:column>
                <f:facet name="header">Idcategorie</f:facet>
                <h:outputText value="#{_categorie.idcategorie}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Libelle</f:facet>
                <h:outputText value="#{_categorie.libelle}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewcategorie"
                     value="View"
                      view="/Categorie.xhtml">
                    <f:param name="categorieIdcategorie"
                           value="#{_categorie.idcategorie}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
